#include "udp_client.hpp"
#include <memory>
#include <functional>
#include <thread>

void Usage(const char *proc)
{
    printf("Usage: %s server_ip server_port\n\n", proc);
}

int main(int argc, char *argv[])
{
    //if (argc != 3)
    //{
    //    Usage(argv[0]);
    //    return 1;
    //}
    //std::string serverip = argv[1];
    //uint16_t serverport = atoi(argv[2]);
    
    std::string serverip = "43.143.194.141";
    uint16_t serverport = 8080;
    // std::unique_ptr<UdpClient> udpcli(new UdpClient(serverip, serverport));
    UdpClient udpcli(serverip, serverport);
    udpcli.InitClient();
    std::thread t1(&UdpClient::SendMsg, &udpcli);
    std::thread t2(&UdpClient::RecvMsg, &udpcli);
    t1.join();
    t2.join();
    return 0;
}
